/*
 * map.c
 *
 *  Created on: Apr 5, 2012
 *      Author: Tri_D
 */
#include <mc9s08ll64.h>
#include "main header.h"

/* Mapping for 6 digits weight */
			//	 A		 B	     C		  D		 E		F		G
uint8_t * D_Reg[49] = 
{
		&LCDWF3 ,&LCDWF4 ,&LCDWF4 ,&LCDWF3 ,&LCDWF5 ,&LCDWF5 ,&LCDWF3,
		&LCDWF6 ,&LCDWF7 ,&LCDWF7 ,&LCDWF6 ,&LCDWF8 ,&LCDWF8 ,&LCDWF6,
		&LCDWF9 ,&LCDWF10,&LCDWF10,&LCDWF9 ,&LCDWF11,&LCDWF11,&LCDWF9,
		&LCDWF12,&LCDWF13,&LCDWF13,&LCDWF12,&LCDWF14,&LCDWF14,&LCDWF12,
		&LCDWF15,&LCDWF16,&LCDWF16,&LCDWF15,&LCDWF17,&LCDWF17,&LCDWF15,
		&LCDWF18,&LCDWF19,&LCDWF19,&LCDWF18,&LCDWF20,&LCDWF20,&LCDWF18
};             
const uint8_t Digit_S[7]= {0	  ,0      ,1      ,2	  ,1      ,0	  ,1      };



/* Mapping for unit */
					// 	  A9 	   A10		A11		 A12	  A13	   A14
uint8_t * U_Reg[6] = {&LCDWF29, &LCDWF29, &LCDWF30, &LCDWF30, &LCDWF31, &LCDWF31};
const uint8_t U_S[6]   = {1		 , 2	  , 1	   , 2		, 1		 , 2};

/* Mapping for Mode */
					//		A		B		 C			D		E		F			G		H		I		J			K		L		M		N	
uint8_t * M_Reg[14] = {&LCDWF21, &LCDWF22, &LCDWF22, &LCDWF23, &LCDWF23, &LCDWF23, &LCDWF24, &LCDWF25, &LCDWF24, &LCDWF21, &LCDWF25, &LCDWF24, &LCDWF21, &LCDWF25};
const uint8_t M_S[14]   = {0	  , 0	   , 1		, 2		 , 1	  , 0	   , 1		, 1		 , 0	  , 1 	   , 0		, 2		 , 2	  , 2 	   };

/* Mapping for annunciation */
					//	   A1		 A2		   A3		 A4	       A5		 A6		   A7		  A8	   CAL		  Zero     Stable   L_Colon    R_Colon	
    uint8_t * AN_Reg[13]= {&LCDWF26, &LCDWF26, &LCDWF26, &LCDWF27, &LCDWF27, &LCDWF27, &LCDWF28, &LCDWF28, &LCDWF19, &LCDWF32, &LCDWF32, &LCDWF34, &LCDWF34};
const uint8_t AN_S[13]	= {0	   , 1 	     , 2	   , 2 	     , 1	   , 0	     , 1		, 2		  , 2	    , 0       , 1	   , 0		  , 1      };


/* Mapping for battery */
					// 		B1		B2		B3		 B4			B5	   Shift
uint8_t * B_Reg[5] = {&LCDWF33, &LCDWF29, &LCDWF30, &LCDWF28, &LCDWF31};

/* Mapping for decimal point */
					// 		DP1		 DP2	  DP3	   DP4	    DP5	   Shift
uint8_t * Dcp_Reg[5] = {&LCDWF4, &LCDWF7, &LCDWF10, &LCDWF13, &LCDWF16};
